﻿using BCDto.TMS.RedPacket.RedPacketType;
using BCDto.TMS.RedPacket.RedPacketType.RedPacketTypeRequest;
using BCService.TMS.RedPacket.RedPacketType;
using BCTMSRESTful.Configs;
using Microsoft.AspNetCore.Mvc;

namespace BCTMSRESTful.Controllers.Management.TMS.RedPacket
{
    /// <summary>
    /// 红包类型
    /// </summary>
    [ApiExplorerSettings(GroupName = "TMSAdmin")]
    [Route("api/v1/sim/[controller]")]
    public class RedPacketTypeController : ManagementBaseController
    {
        private readonly IRedPacketTypeService redPacketTypeService;
        public RedPacketTypeController(IRedPacketTypeService redPacketTypeService)
        {
            this.redPacketTypeService = redPacketTypeService;
        }

        /// <summary>
        /// 创建红包类型。
        /// </summary>
        /// <param name="requestDto">红包</param>
        /// <response code="201">创建红包类型。</response>
        /// <returns></returns>
        [HttpPost]
        [Log("创建红包类型")]
        [ProducesResponseType(typeof(RedPacketTypeDto), 200)]
        public IActionResult Create([FromBody] RedPacketTypeRequestDto requestDto)
        {
            var result = this.redPacketTypeService.Create(requestDto, this.Admin);
            return this.Ok(result);
        }

    }
}
